<template>
    <div class="bidderDialog">
        <el-dialog title="竞买人" :visible.sync="recordShow" width="1050px" :before-close="cancelBtn">
           <div class="header_search">
                <div class="input_l">
                    <div class="label">竞拍号:</div>
                    <el-input v-model="searchNum" placeholder="请输入竞买人名称" size="mini"></el-input>
                    <div class="label">出价时间:</div>
                    <el-date-picker
                    v-model="timeSe"
                    type="datetimerange"
                    size="mini"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期">
                    </el-date-picker>
                </div>
                <div>
                    <el-button type="primary" size="mini">检索</el-button>
                    <el-button type="primary" size="mini">导出</el-button>
                </div>
           </div>
           <el-table
            :data="listRecord"
            style="width: 100%">
                <el-table-column prop="bidnum" label="竞拍号"></el-table-column>
                <el-table-column prop="name" label="竞买人"></el-table-column>
                <el-table-column prop="price" label="出价"></el-table-column>
                <el-table-column prop="create_time" label="出价时间"></el-table-column>
            </el-table>
            <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="page"
            :page-sizes="[7, 20, 30, 40]"
            :page-size="limit"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
            </el-pagination>
        </el-dialog>

        
    </div>
   
</template>

<script>
import {bidRecord} from '@/api/release'
export default {
    props:{
        recordShow:[Boolean],
        idrecord:[String,Number],
    },
    data(){
        return{
            page:1,
            limit:10,
            total:0,
            searchNum:'',
            timeSe:'',
            listRecord:[]
        }
    },
    created(){
       
    },
    watch:{
        recordShow:{
            handler(newval,oldval){
                if(newval){
                    this.getPageData();
                }
            }
        }
    },
    methods:{
        getPageData(){
            bidRecord({id:this.idrecord,page:this.page,limit:this.limit}).then(res => {
                this.listRecord = res.data;
                this.total = res.count;
            });
        },
        //点击取消
        cancelBtn(){
            this.$emit('closeRoecordLog');
        },
        // 分页
        handleSizeChange(val) {
            this.limit = val
            this.getPageData()
        },
        // 分页
        handleCurrentChange(val) {
            this.page = val
            this.getPageData()
        },
    }
}
</script>

<style lang="scss" scoped>
 .bidderDialog{
    .header_search{
        display: flex;
        justify-content: space-between;
        align-items: center;
        .input_l{
            display: flex;
            align-items: center;
            .label{
                width: 130px;
                text-align: right;
                margin-right: 10px;
            }
        }
    }
 }
</style>
  